﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using TheStar.Lib;

namespace TheStar.GUI
{
    public partial class ShowPathForm : Form
    {
        #region constructors
        public ShowPathForm()
        {
            this.InitializeComponent();
        }
        public ShowPathForm(Path path)
            : this()
        {
            this.ShowPath(path);
        } 
        #endregion

        #region methods
        private void ShowPath(Path path)
        {
            if (path == null)
            {
                this.txtCustoTotal.Text = "N/A";
                this.dgvCaminho.DataSource = null;
            }
            else
            {
                this.txtCustoTotal.Text = path.Cost.ToString();
                this.dgvCaminho.DataSource = path.AsList();
            }
        } 
        #endregion
    }
}
